/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       army_dialog.h

	$Header: /game/army_dialog.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef ARMY_DIALOG_H_INCLUDED
#define ARMY_DIALOG_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#pragma warning( disable: 4786 )

#include <map>
#include <vector>
#include "army.h"
#include "army_array_ptr.h"
#include "army_dialog_base.h"
#include "army_list_window_ptr.h"
#include "army_ptr.h"
#include "artifact_icon_ptr.h"
#include "artifact_slot.h"
#include "bitmap_layer_window.h"
#include "bitmap_layer_window_ptr.h"
#include "bitmap_group_ptr.h"
#include "button_group.h"
#include "creature_array_window.h"
#include "creature_array_window_ptr.h"
#include "handler.h"
#include "skill_icon_ptr.h"
#include "text_window_ptr.h"
#include "toggle_button_ptr.h"

class t_adventure_frame;
class t_button;
class t_combat_model_window;
class t_creature_array;
class t_bitmap_layer_cache_window;
enum  t_creature_type;
class t_drag_artifact;
class t_drag_artifact_source;
class t_hero;
class t_morale_icon_window;
class t_luck_icon_window;

// -----------------------------------------------------------------------
// dialog to manipulate one or two armies
// -----------------------------------------------------------------------
class t_army_dialog : public t_army_dialog_base
{
public:
	t_army_dialog( t_army* army, t_army* adjacent_army, t_adventure_frame* adventure_frame,
		           int selected_slot = -1 );

	void			set_enemy_attack_handler( t_handler enemy_attack_handler );
	void			trigger_events();

protected:
	typedef std::map<t_army_ptr, t_army_ptr> t_army_map;

    void            army_down_clicked( t_button* button );
    void            army_up_clicked( t_button* button );
	void			check_for_allied_and_graveyard();
	virtual void	close_creature_windows();
	void			enemy_attack_handler();
	virtual void	get_artifact_pile_position( t_adv_map_point & point, t_counted_ptr< t_adv_artifact_pile > & pile );
	virtual void	get_transfer_costs( int & cost_in, int & cost_out ) const;
	virtual void	on_close();
	void			pull_artifacts_from_graveyards();
	void			select_army( t_army* army );
	void			setup_temp_army();
	void			update_scroll_buttons( int limit_flags );
	void			validate_allied_graveyard_drag_drop( t_creature_array_window::t_drag_drop_validate_data const & data, bool & accept, t_creature_array_window::t_drag_validate_handler allied_handler );
	void			validate_graveyard_drag_drop( t_creature_array_window::t_drag_drop_validate_data const & data, bool & accept );

	t_army_ptr					m_army;
	t_button_ptr                m_army_up_button;
	t_button_ptr                m_army_down_button;
	t_army_list_window_ptr      m_army_list;
	t_handler					m_enemy_attack_handler;
	t_army_ptr                  m_temp_army;
	t_adv_map_point				m_temp_army_position;
	t_army_map                  m_trading_armies;

};


#endif // ARMY_DIALOG_H_INCLUDED
